package com.htrq.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.htrq.dao.DomsticDao;
import com.htrq.entity.Domestic;
import com.htrq.entity.Page;

@Service
@Transactional(value = "txManager")
public class DomesticgasService {
	@Resource
	private DomsticDao domDao;

	public List<Domestic> getAllDomestic(Domestic dom, Page page) {
		// TODO Auto-generated method stub
		List<Domestic> list = domDao.getAllDomestic(dom, page);
		for (Domestic des : list) {
			des.setUid(des.getId() + "");
		}
		return list;
	}
	public Long getTotal(Domestic dom) {
		// TODO Auto-generated method stub
		return domDao.getTotal(dom);
	}
	public boolean modify(Domestic dom) {
		//TODO Auto-generated method stub
		try {
			// 加入公式计算部分
			domDao.modify(dom);
			return true;
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
	}
}
